{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import holoviews as hv\n",
    "hv.extension('matplotlib')\n",
    "hv.output(fig='svg', size=200)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Define data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import sqlite3\n",
    "from bokeh.sampledata import movies_data\n",
    "\n",
    "# Load data\n",
    "conn = sqlite3.connect(movies_data.movie_path)\n",
    "movies = pd.read_sql('SELECT userRating, imdbRating FROM omdb, tomatoes WHERE omdb.ID = tomatoes.ID', conn)\n",
    "\n",
    "# Declare element\n",
    "hextiles = hv.HexTiles(movies, [('userRating', 'Tomato User Rating'), ('imdbRating', 'IMDb Rating')], [])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Plot data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "hextiles.opts(min_count=0) * hv.Bivariate(hextiles)"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python",
   "pygments_lexer": "ipython3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
